﻿' Copyright (c) 2013  DotNetNuke Corporation
'  All rights reserved.
' 
' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
' DEALINGS IN THE SOFTWARE.
' 
Imports DotNetNuke
Imports DotNetNuke.Entities.Modules.Actions
Imports DotNetNuke.Entities.Modules
Imports DotNetNuke.Services.Exceptions
Imports DotNetNuke.Services.Localization
Imports DotNetNuke.Modules.AccordionTabs.Components

''' <summary>
''' The View class displays the content
''' 
''' Typically your view control would be used to display content or functionality in your module.
''' 
''' View may be the only control you have in your project depending on the complexity of your module
''' 
''' Because the control inherits from AccordionTabsModuleBase you have access to any custom properties
''' defined there, as well as properties from DNN such as PortalId, ModuleId, TabId, UserId and many more.
''' 
''' </summary>
Public Class View
    Inherits AccordionTabsModuleBase
    Implements IActionable

    ''' -----------------------------------------------------------------------------
    ''' <summary>
    ''' Page_Load runs when the control is loaded
    ''' </summary>
    ''' <remarks>
    ''' </remarks>
    ''' <history>
    ''' </history>
    ''' -----------------------------------------------------------------------------
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
        Try
            DotNetNuke.Framework.jQuery.RequestDnnPluginsRegistration()
            LoadInitialSettings()
            Dim DNNController As New AccordionTabController
            Dim CurrentTabs As AccordionTabs
            Dim CurrentDisplayStyles As DisplayStyles
            CurrentTabs = DNNController.GetTabs(TabModuleId)
            CurrentDisplayStyles = DNNController.GetDisplayStyles(TabModuleId)
            If IsNothing(CurrentTabs) = True Then
                pnlAccordion.Controls.Add(New LiteralControl("You have not defined any Tabs to show. Please add a Tab via the 'Edit Content' link."))
            ElseIf CurrentTabs.Count = 0 Then
                pnlAccordion.Controls.Add(New LiteralControl("You have not defined any Tabs to show. Please add a Tab via the 'Edit Content' link."))
            Else
                If IsNothing(CurrentDisplayStyles.Item(0)) = True Then
                    LoadAccordionTabs(CurrentTabs)
                Else
                    Select Case CurrentDisplayStyles.Item(0).DisplayStyle
                        Case "Accordion"
                            LoadAccordionTabs(CurrentTabs)
                        Case "Tabs"
                            LoadStandardTabs(CurrentTabs)
                        Case "'jShowOff' - Content Slider"
                            LoadJQueryShowOff(CurrentTabs)
                        Case Else
                            '
                            'Display stuff in AccordionTabs if all else fails.
                            '
                            LoadAccordionTabs(CurrentTabs)
                    End Select
                End If
            End If
            CurrentTabs = Nothing
            CurrentDisplayStyles = Nothing
        DNNController.Dispose()
        DNNController = Nothing
        Catch exc As Exception
            Exceptions.ProcessModuleLoadException(Me, exc)
        End Try

    End Sub

    Protected Sub LoadInitialAccordionSettings()
        Try
            If Settings.Contains("Accordion_CSSClass") = True Then
            Else
                Settings("Accordion_CSSClass") = "AccordionTabs"
            End If
            If Settings.Contains("Accordion_TabHeader") = True Then
            Else
                Settings("Accordion_TabHeader") = "dnnFormSectionHead"
            End If
            If Settings.Contains("Accordion_RegionToToggle") = True Then
            Else
                Settings("Accordion_RegionToToggle") = "fieldset"
            End If
            If Settings.Contains("Accordion_ClickToToggleSelector") = True Then
            Else
                Settings("Accordion_ClickToToggleSelector") = "a"
            End If
            If Settings.Contains("Accordion_CookieDays") = True Then
            Else
                Settings("Accordion_CookieDays") = "0"
            End If
            If Settings.Contains("CookieMilleseconds") = True Then
            Else
                Settings("Accordion_CookieMilleseconds") = "120000"
            End If
        Catch exc As Exception
            Exceptions.ProcessModuleLoadException(Me, exc)
        End Try
    End Sub

    Protected Sub LoadInitialTabSettings()
        Try
            If Settings.Contains("Tabs_CSSClass") = True Then
            Else
                Settings("Tabs_CSSClass") = "dnnAdminTabNav"
            End If
            If Settings.Contains("Tabs_CookieDays") = True Then
            Else
                Settings("Tabs_CookieDays") = "0"
            End If
            If Settings.Contains("Tabs_CookieMilleseconds") = True Then
            Else
                Settings("Tabs_CookieMilleseconds") = "120000"
            End If
        Catch exc As Exception
            Exceptions.ProcessModuleLoadException(Me, exc)
        End Try
    End Sub

    Protected Sub LoadInitialjShowOffSettings()
        Try
            If Settings.Contains("jShowOff_CSSClass") = True Then
            Else
                Settings("jShowOff_CSSClass") = ""
            End If
            If Settings.Contains("jShowOff_animatePause") = True Then
            Else
                Settings("jShowOff_animatePause") = "true"
            End If
            If Settings.Contains("jShowOff_autoPlay") = True Then
            Else
                Settings("jShowOff_autoPlay") = "true"
            End If
            If Settings.Contains("jShowOff_changeSpeed") = True Then
            Else
                Settings("jShowOff_changeSpeed") = "600"
            End If
            If Settings.Contains("jShowOff_controls") = True Then
            Else
                Settings("jShowOff_controls") = "true"
            End If
            If Settings.Contains("jShowOff_controlText") = True Then
            Else
                Settings("jShowOff_controlText") = "{ play:'Play', pause:'Pause', previous:'Previous', next:'Next' }"
            End If
            If Settings.Contains("jShowOff_effect") = True Then
            Else
                Settings("jShowOff_effect") = "none"
            End If
            If Settings.Contains("jShowOff_hoverPause") = True Then
            Else
                Settings("jShowOff_hoverPause") = "true"
            End If
            If Settings.Contains("jShowOff_links") = True Then
            Else
                Settings("jShowOff_links") = "true"
            End If
            If Settings.Contains("jShowOff_speed") = True Then
            Else
                Settings("jShowOff_speed") = "3000"
            End If
        Catch exc As Exception
            Exceptions.ProcessModuleLoadException(Me, exc)
        End Try
    End Sub

    Protected Sub LoadInitialSettings()
        Try
            LoadInitialAccordionSettings()
            LoadInitialTabSettings()
            LoadInitialjShowOffSettings()
        Catch exc As Exception
            Exceptions.ProcessModuleLoadException(Me, exc)
        End Try
    End Sub

    ''' -----------------------------------------------------------------------------
    ''' <summary>
    ''' Registers the module actions required for interfacing with the portal framework
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    ''' <history>
    ''' </history>
    ''' -----------------------------------------------------------------------------
    ''' 
    Public ReadOnly Property ModuleActions() As ModuleActionCollection Implements IActionable.ModuleActions
        Get
            Dim Actions As New ModuleActionCollection
            Actions.Add(GetNextActionID, Localization.GetString("EditModule", LocalResourceFile), Entities.Modules.Actions.ModuleActionType.AddContent, "", "", EditUrl(), False, DotNetNuke.Security.SecurityAccessLevel.Edit, True, False)
            Return Actions
        End Get
    End Property

    Protected Sub LoadAccordionTabs(ByVal CurrentTabs As AccordionTabs)
        Try
            pnlAccordion.Controls.Add(New LiteralControl("<div class='" + Settings("Accordion_CSSClass").ToString + "' ID='AccordionTabs_" + TabModuleId.ToString + "'>"))
            For Each CurrentTab As AccordionTab In CurrentTabs
                If CurrentTab.IsVisible = True Then
                    pnlAccordion.Controls.Add(New LiteralControl("<h2 class='" + Settings("Accordion_TabHeader").ToString + "'><" + Settings("Accordion_ClickToToggleSelector").ToString + " href='#'>" + Server.HtmlDecode(CurrentTab.TitleOfTab) + "</" + Settings("Accordion_ClickToToggleSelector").ToString + "></h2>"))
                    pnlAccordion.Controls.Add(New LiteralControl("<" + Settings("Accordion_RegionToToggle").ToString + " class='dnnClear'>" + Server.HtmlDecode(CurrentTab.ContentOfTab) + "</" + Settings("Accordion_RegionToToggle").ToString + ">"))
                End If
            Next
            pnlAccordion.Controls.Add(New LiteralControl("</div>"))
            pnlAccordion.Controls.Add(New LiteralControl("<script type='text/javascript'>" + _
                                                            "(function ($, Sys) {" + _
                                                                    "function DisplayDNNPanels() {" + _
                                                                        "$('#AccordionTabs_" + TabModuleId.ToString() + "').dnnPanels({" + _
                                                                        "clickToToggleSelector: 'h2." + Settings("Accordion_TabHeader").ToString + " " + Settings("Accordion_ClickToToggleSelector").ToString + "'," + _
                                                                        "sectionHeadSelector: '." + Settings("Accordion_TabHeader").ToString + "'," + _
                                                                        "regionToToggleSelector: '" + Settings("Accordion_RegionToToggle").ToString + "'," + _
                                                                        "clickToToggleIsolatedSelector: '" + Settings("Accordion_ClickToToggleSelector").ToString + "'," + _
                                                                        "cookieDays: " + Settings("Accordion_CookieDays").ToString + "," + _
                                                                        "cookieMilleseconds: " + Settings("Accordion_CookieMilleseconds").ToString + "});" + _
                                                                    "}" + _
                                                                "$(document).ready(function () {" + _
                                                                    "DisplayDNNPanels();" + _
                                                                    "Sys.WebForms.PageRequestManager.getInstance().add_endRequest(function () {" + _
                                                                        "DisplayDNNPanels();" + _
                                                                    "});" + _
                                                                "});" + _
                                                            "}(jQuery, window.Sys));" + _
                                                        "</script>"))
            '
            'Hack to make all Accordion Panels collapsed when the page is loaded. Only happens if people change
            'the appropriate setting in the Settings section of this module.
            '
            If CType(Settings("Accordion_HideTabsOnStartup"), String) = "true" Then
                pnlAccordion.Controls.Add(New LiteralControl("<script type='text/javascript'>" + _
                                                                "(" + _
                                                                    "function ($, Sys) {" + _
                                                                        "function HideAllPanels() " + _
                                                                            "{" + _
                                                                                "$('#AccordionTabs_" + TabModuleId.ToString() + " a[href]').each(function(idx, item) {" + _
                                                                                    "$( this ).removeClass('dnnSectionExpanded');" + _
                                                                                "});" + _
                                                                                "$('#AccordionTabs_" + TabModuleId.ToString() + " fieldset').each(function(idx, item) {" + _
                                                                                    "$( this ).css('display','none');" + _
                                                                                "});" + _
                                                                            "}" + _
                                                                        "$(document).ready(" + _
                                                                            "function () {" + _
                                                                                "HideAllPanels();" + _
                                                                                "Sys.WebForms.PageRequestManager.getInstance().add_endRequest(" + _
                                                                                    "function () {" + _
                                                                                        "HideAllPanels();" + _
                                                                                    "}" + _
                                                                                ");" + _
                                                                            "}" + _
                                                                        ");" + _
                                                                    "}" + _
                                                                "(jQuery, window.Sys));" + _
                                                                "</script>"))
            Else

            End If
        Catch exc As Exception
            Exceptions.ProcessModuleLoadException(Me, exc)
        End Try
    End Sub

    Protected Sub LoadStandardTabs(ByVal CurrentTabs As AccordionTabs)
        Try
            pnlAccordion.Controls.Add(New LiteralControl("<div class='dnnForm' ID='AccordionTabs_" + TabModuleId.ToString + "'>"))
            pnlAccordion.Controls.Add(New LiteralControl("<ul class='" + Settings("Tabs_CSSClass") + "'>"))
            For Each CurrentTab As AccordionTab In CurrentTabs
                If CurrentTab.IsVisible = True Then
                    pnlAccordion.Controls.Add(New LiteralControl("<li><a href='#Tab_ModuleID_" + TabModuleId.ToString + "_TabID_" + CurrentTab.ItemID.ToString + "'>" + Server.HtmlDecode(CurrentTab.TitleOfTab) + "</a></li>"))
                End If
            Next
            pnlAccordion.Controls.Add(New LiteralControl("</ul>"))
            For Each CurrentTab As AccordionTab In CurrentTabs
                If CurrentTab.IsVisible = True Then
                    pnlAccordion.Controls.Add(New LiteralControl("<div id='Tab_ModuleID_" + TabModuleId.ToString + "_TabID_" + CurrentTab.ItemID.ToString + "' class='dnnClear'>" + Server.HtmlDecode(CurrentTab.ContentOfTab) + "</div>"))
                End If
            Next
            pnlAccordion.Controls.Add(New LiteralControl("</div>"))
            pnlAccordion.Controls.Add(New LiteralControl("<script type='text/javascript'>" + _
                                                            "(function ($, Sys) {" + _
                                                                    "function DisplayDNNTabs() {" + _
                                                                        "$('#AccordionTabs_" + TabModuleId.ToString() + "').dnnTabs({" + _
                                                                        "cookieDays: " + Settings("Tabs_CookieDays").ToString + "," + _
                                                                        "cookieMilleseconds: " + Settings("Tabs_CookieMilleseconds").ToString + "});" + _
                                                                    "}" + _
                                                                "$(document).ready(function () {" + _
                                                                    "DisplayDNNTabs();" + _
                                                                    "Sys.WebForms.PageRequestManager.getInstance().add_endRequest(function () {" + _
                                                                        "DisplayDNNTabs();" + _
                                                                    "});" + _
                                                                "});" + _
                                                            "}(jQuery, window.Sys));" + _
                                                        "</script>"))
        Catch exc As Exception
            Exceptions.ProcessModuleLoadException(Me, exc)
        End Try
    End Sub

    Protected Sub LoadJQueryShowOff(ByVal CurrentTabs As AccordionTabs)
        Try
            '
            'The jQuery ShowOff Code
            '
            Dim strJShowOffCode As String = ""
            strJShowOffCode = "<script type='text/javascript'>/*" + _
            "Title:		jShowOff: a jQuery Content Rotator Plugin" + _
            "Author:		Erik Kallevig" + _
            "Version:	0.1.2" + _
            "Website:	http://ekallevig.com/jshowoff" + _
            "License: 	Dual licensed under the MIT and GPL licenses." + _
            "*/" + _
            "(function($){$.fn.jshowoff=function(settings){var config={animatePause:true,autoPlay:true,changeSpeed:600,controls:true,controlText:{play:'Play',pause:'Pause',next:'Next',previous:'Previous'},effect:'fade',hoverPause:true,links:true,speed:3000};if(settings)$.extend(true,config,settings);if(config.speed<(config.changeSpeed+20)){alert('jShowOff: Make speed at least 20ms longer than changeSpeed; the fades aren\'t always right on time.');return this;};this.each(function(i){var $cont=$(this);var gallery=$(this).children().remove();var timer='';var counter=0;var preloadedImg=[];var howManyInstances=$('.jshowoff').length+1;var uniqueClass='jshowoff-'+howManyInstances;var cssClass=config.cssClass!=undefined?config.cssClass:'';$cont.css('position','relative').wrap('<div class=" + _
            ControlChars.Quote + _
            "jshowoff '+uniqueClass+'" + _
            ControlChars.Quote + _
            "/>');var" + _
            " $wrap=$('.'+uniqueClass);$wrap.css('position','relative').addClass(cssClass);$(gallery[0]).clone().appendTo($cont);preloadImg();if(config.controls){addControls();if(config.autoPlay==false){$('.'+uniqueClass+'-play').addClass(uniqueClass+'-paused jshowoff-paused').text(config.controlText.play);};};if(config.links){addSlideLinks();$('.'+uniqueClass+'-slidelinks a').eq(0).addClass(uniqueClass+'-active jshowoff-active');};if(config.hoverPause){$cont.hover(function(){if(isPlaying())pause('hover');},function(){if(isPlaying())play('hover');});};if(config.autoPlay&&gallery.length>1){timer=setInterval(function(){play();},config.speed);};if(gallery.length<1){$('.'+uniqueClass).append('<p>For jShowOff to work, the container element must have child elements.</p>');};function transitionTo(gallery,index){var oldCounter=counter;if((counter>=gallery.length)||(index>=gallery.length)){counter=0;var e2b=true;}" + _
            "else if((counter<0)||(index<0)){counter=gallery.length-1;var b2e=true;}" + _
            "else{counter=index;}" + _
            "if(config.effect=='slideLeft'){var newSlideDir,oldSlideDir;function slideDir(dir){newSlideDir=dir=='right'?'left':'right';oldSlideDir=dir=='left'?'left':'right';};counter>=oldCounter?slideDir('left'):slideDir('right');$(gallery[counter]).clone().appendTo($cont).slideIt({direction:newSlideDir,changeSpeed:config.changeSpeed});if($cont.children().length>1){$cont.children().eq(0).css('position','absolute').slideIt({direction:oldSlideDir,showHide:'hide',changeSpeed:config.changeSpeed},function(){$(this).remove();});};}else if(config.effect=='fade'){$(gallery[counter]).clone().appendTo($cont).hide().fadeIn(config.changeSpeed,function(){if($.browser.msie)this.style.removeAttribute('filter');});if($cont.children().length>1){$cont.children().eq(0).css('position','absolute').fadeOut(config.changeSpeed,function(){$(this).remove();});};}else if(config.effect=='none'){$(gallery[counter]).clone().appendTo($cont);if($cont.children().length>1){$cont.children().eq(0).css('position','absolute').remove();};};if(config.links){$('.'+uniqueClass+'-active').removeClass(uniqueClass+'-active jshowoff-active');$('.'+uniqueClass+'-slidelinks a').eq(counter).addClass(uniqueClass+'-active jshowoff-active');};};function isPlaying(){return $('.'+uniqueClass+'-play').hasClass('jshowoff-paused')?false:true;};function play(src){if(!isBusy()){counter++;transitionTo(gallery,counter);if(src=='hover'||!isPlaying()){timer=setInterval(function(){play();},config.speed);}" + _
            "if(!isPlaying()){$('.'+uniqueClass+'-play').text(config.controlText.pause).removeClass('jshowoff-paused '+uniqueClass+'-paused');}};};function pause(src){clearInterval(timer);if(!src||src=='playBtn')$('.'+uniqueClass+'-play').text(config.controlText.play).addClass('jshowoff-paused '+uniqueClass+'-paused');if(config.animatePause&&src=='playBtn'){$('<p class=" + ControlChars.Quote + _
            "'+uniqueClass+'-pausetext jshowoff-pausetext" + ControlChars.Quote + _
            ">'+config.controlText.pause+'</p>').css({fontSize:'62%',textAlign:'center',position:'absolute',top:'40%',lineHeight:'100%',width:'100%'}).appendTo($wrap).addClass(uniqueClass+'pauseText').animate({fontSize:'600%',top:'30%',opacity:0},{duration:500,complete:function(){$(this).remove();}});}};function next(){goToAndPause(counter+1);};function previous(){goToAndPause(counter-1);};function isBusy(){return $cont.children().length>1?true:false;};function goToAndPause(index){$cont.children().stop(true,true);if((counter!=index)||((counter==index)&&isBusy())){if(isBusy())$cont.children().eq(0).remove();transitionTo(gallery,index);pause();};};function preloadImg(){$(gallery).each(function(i){$(this).find('img').each(function(i){preloadedImg[i]=$('<img>').attr('src',$(this).attr('src'));});});};function addControls(){$wrap.append('<p class=" + ControlChars.Quote + _
            "jshowoff-controls '+uniqueClass+'-controls" + ControlChars.Quote + _
            "><a class=" + ControlChars.Quote + _
            "jshowoff-play '+uniqueClass+'-play" + ControlChars.Quote + _
            " href=" + ControlChars.Quote + _
            "#null" + ControlChars.Quote + _
            ">'+config.controlText.pause+'</a> <a class=" + ControlChars.Quote + _
            "jshowoff-prev '+uniqueClass+'-prev" + ControlChars.Quote + _
            " href=" + ControlChars.Quote + _
            "#null" + ControlChars.Quote + _
            ">'+config.controlText.previous+'</a> <a class=" + ControlChars.Quote + _
            "jshowoff-next '+uniqueClass+'-next" + ControlChars.Quote + _
            " href=" + ControlChars.Quote + _
            "#null" + ControlChars.Quote + _
            ">'+config.controlText.next+'</a></p>');$('.'+uniqueClass+'-controls a').each(function(){if($(this).hasClass('jshowoff-play'))$(this).click(function(){isPlaying()?pause('playBtn'):play();return false;});if($(this).hasClass('jshowoff-prev'))$(this).click(function(){previous();return false;});if($(this).hasClass('jshowoff-next'))$(this).click(function(){next();return false;});});};function addSlideLinks(){$wrap.append('<p class=" + ControlChars.Quote + _
            "jshowoff-slidelinks '+uniqueClass+'-slidelinks" + ControlChars.Quote + _
            "></p>');$.each(gallery,function(i,val){var linktext=$(this).attr('title')!=''?$(this).attr('title'):i+1;$('<a class=" + ControlChars.Quote + _
            "jshowoff-slidelink-'+i+' '+uniqueClass+'-slidelink-'+i+'" + ControlChars.Quote + _
            " href=" + ControlChars.Quote + _
            "#null" + ControlChars.Quote + _
            ">'+linktext+'</a>').bind('click',{index:i},function(e){goToAndPause(e.data.index);return false;}).appendTo('.'+uniqueClass+'-slidelinks');});};});return this;};})(jQuery);(function($){$.fn.slideIt=function(settings,callback){var config={direction:'left',showHide:'show',changeSpeed:600};if(settings)$.extend(config,settings);this.each(function(i){$(this).css({left:'auto',right:'auto',top:'auto',bottom:'auto'});var measurement=(config.direction=='left')||(config.direction=='right')?$(this).outerWidth():$(this).outerHeight();var startStyle={};startStyle['position']=$(this).css('position')=='static'?'relative':$(this).css('position');startStyle[config.direction]=(config.showHide=='show')?'-'+measurement+'px':0;var endStyle={};endStyle[config.direction]=config.showHide=='show'?0:'-'+measurement+'px';$(this).css(startStyle).animate(endStyle,config.changeSpeed,callback);});return this;};})(jQuery);</script>"
            '
            'End Code
            '
            pnlAccordion.Controls.Add(New LiteralControl("<div class='dnnForm' ID='AccordionTabs_" + TabModuleId.ToString + "'>"))
            For Each CurrentTab As AccordionTab In CurrentTabs
                If CurrentTab.IsVisible = True Then
                    pnlAccordion.Controls.Add(New LiteralControl("<div id='Tab_ModuleID_" + TabModuleId.ToString + "_TabID_" + CurrentTab.ItemID.ToString + "' title='" + Server.HtmlDecode(CurrentTab.TitleOfTab) + "'>" + Server.HtmlDecode(CurrentTab.ContentOfTab) + "</div>"))
                End If
            Next
            pnlAccordion.Controls.Add(New LiteralControl("</div>"))
            pnlAccordion.Controls.Add(New LiteralControl(strJShowOffCode))
            pnlAccordion.Controls.Add(New LiteralControl("<script type='text/javascript'>" + _
                                                            "(function ($, Sys) {" + _
                                                                    "function DisplayDNNjQueryShowOff() {" + _
                                                                        "$('#AccordionTabs_" + TabModuleId.ToString() + "').jshowoff({" + _
                                                                        "animatePause: " + Settings("jShowOff_animatePause") + "," + _
                                                                        "autoPlay: " + Settings("jShowOff_autoPlay") + "," + _
                                                                        "changeSpeed: " + Settings("jShowOff_changeSpeed") + "," + _
                                                                        "controls: " + Settings("jShowOff_controls") + "," + _
                                                                        "controlText: " + Settings("jShowOff_controlText") + "," + _
                                                                        "cssClass: '" + Settings("jShowOff_cssClass") + "'," + _
                                                                        "effect: '" + Settings("jShowOff_effect") + "'," + _
                                                                        "hoverPause: " + Settings("jShowOff_hoverPause") + "," + _
                                                                        "links: " + Settings("jShowOff_links") + "," + _
                                                                        "speed: " + Settings("jShowOff_speed") + "" + _
                                                                        "});" + _
                                                                    "}" + _
                                                                "$(document).ready(function () {" + _
                                                                    "DisplayDNNjQueryShowOff();" + _
                                                                    "Sys.WebForms.PageRequestManager.getInstance().add_endRequest(function () {" + _
                                                                        "DisplayDNNjQueryShowOff();" + _
                                                                    "});" + _
                                                                "});" + _
                                                            "}(jQuery, window.Sys));" + _
                                                        "</script>"))
        Catch exc As Exception
            Exceptions.ProcessModuleLoadException(Me, exc)
        End Try
    End Sub
End Class